# @Time    :2025/4/1 16:38
class MyException(Exception):
    def __init__(self, value):
        self.value = value


try:
    # 可能发生异常的代码
    raise MyException("这是我自己定义的异常")
except MyException as e:
    print(f"发生异常了{e}")
